home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / CardServices.p < prev    next >
Text File  |  1996-05-01  |  31KB  |  874 lines

  1. {
  2.      File:        CardServices.p
  3.  
  4.      Contains:    The client interface to Card and Socket Services.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT CardServices;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CARDSERVICES__}
  28. {$SETC __CARDSERVICES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC CardServicesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __PCCARDTUPLES__}
  38. {$I PCCardTuples.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __MIXEDMODE__}
  41. {$I MixedMode.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. {     miscellaneous }
  49.  
  50. CONST
  51.     CS_MAX_SOCKETS                = 32;                            {  a long is used as a socket bitmap }
  52.  
  53. {  Will move to <Gestalt.h> }
  54.     gestaltCardServicesAttr        = 'pccd';                        {  Card Services attributes }
  55.     gestaltCardServicesPresent    = 0;                            {  if set, Card Services is present }
  56.     gestaltCardServicesSupportsRequestIO = 1;                    {  if set, CSRequest/ReleaseIO are supported }
  57.  
  58. {  Will move to <Traps.h> }
  59.     _PCCardDispatch                = $AAF0;                        {  Card Services entry trap }
  60.  
  61. {
  62.  Will move to <Errors.h>
  63.     result codes
  64. }
  65.     kCSBadAdapterErr            = -9050;                        {  invalid adapter number }
  66.     kCSBadAttributeErr            = -9051;                        {  specified attributes field value is invalid }
  67.     kCSBadBaseErr                = -9052;                        {  specified base system memory address is invalid }
  68.     kCSBadEDCErr                = -9053;                        {  specified EDC generator specified is invalid }
  69.     kCSBadIRQErr                = -9054;                        {  specified IRQ level is invalid }
  70.     kCSBadOffsetErr                = -9055;                        {  specified PC card memory array offset is invalid }
  71.     kCSBadPageErr                = -9056;                        {  specified page is invalid }
  72.     kCSBadSizeErr                = -9057;                        {  specified size is invalid }
  73.     kCSBadSocketErr                = -9058;                        {  specified logical or physical socket number is invalid }
  74.     kCSBadTypeErr                = -9059;                        {  specified window or interface type is invalid }
  75.     kCSBadVccErr                = -9060;                        {  specified Vcc power level index is invalid }
  76.     kCSBadVppErr                = -9061;                        {  specified Vpp1 or Vpp2 power level index is invalid }
  77.     kCSBadWindowErr                = -9062;                        {  specified window is invalid }
  78.     kCSBadArgLengthErr            = -9063;                        {  ArgLength argument is invalid }
  79.     kCSBadArgsErr                = -9064;                        {  values in argument packet are invalid }
  80.     kCSBadHandleErr                = -9065;                        {  clientHandle is invalid }
  81.     kCSBadCISErr                = -9066;                        {  CIS on card is invalid }
  82.     kCSBadSpeedErr                = -9067;                        {  specified speed is unavailable }
  83.     kCSReadFailureErr            = -9068;                        {  unable to complete read request }
  84.     kCSWriteFailureErr            = -9069;                        {  unable to complete write request }
  85.     kCSGeneralFailureErr        = -9070;                        {  an undefined error has occurred }
  86.     kCSNoCardErr                = -9071;                        {  no PC card in the socket }
  87.     kCSUnsupportedFunctionErr    = -9072;                        {  function is not supported by this implementation }
  88.     kCSUnsupportedModeErr        = -9073;                        {  mode is not supported }
  89.     kCSBusyErr                    = -9074;                        {  unable to process request at this time - try later }
  90.     kCSWriteProtectedErr        = -9075;                        {  media is write-protected }
  91.     kCSConfigurationLockedErr    = -9076;                        {  a configuration has already been locked }
  92.     kCSInUseErr                    = -9077;                        {  requested resource is being used by a client }
  93.     kCSNoMoreItemsErr            = -9078;                        {  there are no more of the requested item }
  94.     kCSOutOfResourceErr            = -9079;                        {  Card Services has exhausted the resource }
  95.  
  96. {     messages sent to client's event handler }
  97.     kCSNullMessage                = $00;                            {  no messages pending (not sent to clients) }
  98.     kCSCardInsertionMessage        = $01;                            {  card has been inserted into the socket }
  99.     kCSCardRemovalMessage        = $02;                            {  card has been removed from the socket }
  100.     kCSCardLockMessage            = $03;                            {  card is locked into the socket with a mechanical latch }
  101.     kCSCardUnlockMessage        = $04;                            {  card is no longer locked into the socket }
  102.     kCSCardReadyMessage            = $05;                            {  card is ready to be accessed }
  103.     kCSCardResetMessage            = $06;                            {  physical reset has completed }
  104.     kCSInsertionRequestMessage    = $07;                            {  request to insert a card using insertion motor }
  105.     kCSInsertionCompleteMessage    = $08;                            {  insertion motor has finished inserting a card }
  106.     kCSEjectionRequestMessage    = $09;                            {  user or other client is requesting a card ejection }
  107.     kCSEjectionFailedMessage    = $0A;                            {  eject failure due to electrical/mechanical problems }
  108.     kCSPMResumeMessage            = $0B;                            {  power management resume (TBD) }
  109.     kCSPMSuspendMessage            = $0C;                            {  power management suspend (TBD) }
  110.     kCSResetPhysicalMessage        = $0D;                            {  physical reset is about to occur on this card }
  111.     kCSResetRequestMessage        = $0E;                            {  physical reset has been requested by a client }
  112.     kCSResetCompleteMessage        = $0F;                            {  ResetCard() background reset has completed }
  113.     kCSBatteryDeadMessage        = $10;                            {  battery is no longer useable, data will be lost }
  114.     kCSBatteryLowMessage        = $11;                            {  battery is weak and should be replaced }
  115.     kCSWriteProtectMessage        = $12;                            {  card is now write protected }
  116.     kCSWriteEnabledMessage        = $13;                            {  card is now write enabled }
  117.     kCSClientInfoMessage        = $14;                            {  client is to return client information }
  118.     kCSSSUpdatedMessage            = $15;                            {  AddSocketServices/ReplaceSocket services has changed SS support }
  119.     kCSFunctionInterruptMessage    = $16;                            {  card function interrupt }
  120.     kCSAccessErrorMessage        = $17;                            {  client bus errored on access to socket }
  121.     kCSCardUnconfiguredMessage    = $18;                            {  a CARD_READY was delivered to all clients and no client  }
  122.                                                                 {     requested a configuration for the socket }
  123.     kCSStatusChangedMessage        = $19;                            {  status change for cards in I/O mode }
  124.  
  125. {
  126.     The following is a mapping of the PCMCIA name space to the Macintosh name space.
  127.     These two enum lists will be removed and given to developers as a separate file.
  128. }
  129.     SUCCESS                        = 0;
  130.     BAD_ADAPTER                    = -9050;
  131.     BAD_ATTRIBUTE                = -9051;
  132.     BAD_BASE                    = -9052;
  133.     BAD_EDC                        = -9053;
  134.     BAD_IRQ                        = -9054;
  135.     BAD_OFFSET                    = -9055;
  136.     BAD_PAGE                    = -9056;
  137.     BAD_SIZE                    = -9057;
  138.     BAD_SOCKET                    = -9058;
  139.     BAD_TYPE                    = -9059;
  140.     BAD_VCC                        = -9060;
  141.     BAD_VPP                        = -9061;
  142.     BAD_WINDOW                    = -9062;
  143.     BAD_ARG_LENGTH                = -9063;
  144.     BAD_ARGS                    = -9064;
  145.     BAD_HANDLE                    = -9065;
  146.     BAD_CIS                        = -9066;
  147.     BAD_SPEED                    = -9067;
  148.     READ_FAILURE                = -9068;
  149.     WRITE_FAILURE                = -9069;
  150.     GENERAL_FAILURE                = -9070;
  151.     NO_CARD                        = -9071;
  152.     UNSUPPORTED_FUNCTION        = -9072;
  153.     UNSUPPORTED_MODE            = -9073;
  154.     BUSY                        = -9074;
  155.     WRITE_PROTECTED                = -9075;
  156.     CONFIGURATION_LOCKED        = -9076;
  157.     IN_USE                        = -9077;
  158.     NO_MORE_ITEMS                = -9078;
  159.     OUT_OF_RESOURCE                = -9079;
  160.  
  161. {     messages sent to client's event handler }
  162.     NULL_MESSAGE                = $00;
  163.     CARD_INSERTION                = $01;
  164.     CARD_REMOVAL                = $02;
  165.     CARD_LOCK                    = $03;
  166.     CARD_UNLOCK                    = $04;
  167.     CARD_READY                    = $05;
  168.     CARD_RESET                    = $06;
  169.     INSERTION_REQUEST            = $07;
  170.     INSERTION_COMPLETE            = $08;
  171.     EJECTION_REQUEST            = $09;
  172.     EJECTION_FAILED                = $0A;
  173.     PM_RESUME                    = $0B;
  174.     PM_SUSPEND                    = $0C;
  175.     RESET_PHYSICAL                = $0D;
  176.     RESET_REQUEST                = $0E;
  177.     RESET_COMPLETE                = $0F;
  178.     BATTERY_DEAD                = $10;
  179.     BATTERY_LOW                    = $11;
  180.     WRITE_PROTECT                = $12;
  181.     WRITE_ENABLED                = $13;
  182.     CLIENT_INFO                    = $14;
  183.     SS_UPDATED                    = $15;
  184.     FUNCTION_INTERRUPT            = $16;
  185.     ACCESS_ERROR                = $17;
  186.     CARD_UNCONFIGURED            = $18;
  187.     STATUS_CHANGED                = $19;
  188.  
  189. { ----------------        CSAccessConfigurationRegister    ---------------- }
  190.  
  191. TYPE
  192.     AccessConfigurationRegisterPBPtr = ^AccessConfigurationRegisterPB;
  193.     AccessConfigurationRegisterPB = RECORD
  194.         socket:                    UInt16;                                    {   -> global socket number }
  195.         action:                    SInt8;                                    {   -> read/write }
  196.         offset:                    SInt8;                                    {   -> offset from config register base }
  197.         value:                    SInt8;                                    {  <-> value to read/write }
  198.         padding:                SInt8;                                    {   }
  199.     END;
  200.  
  201. {     `action' field values }
  202.  
  203. CONST
  204.     kCSReadConfigRegister        = $00;
  205.     kCSWriteConfigRegister        = $01;
  206.  
  207. { ----------------        CSGetCardServicesInfo            ---------------- }
  208.  
  209. TYPE
  210.     GetCardServicesInfoPBPtr = ^GetCardServicesInfoPB;
  211.     GetCardServicesInfoPB = RECORD
  212.         signature:                PACKED ARRAY [0..1] OF UInt8;            {  <-  two ascii chars 'CS' }
  213.         count:                    UInt16;                                    {  <-  total number of sockets installed }
  214.         revision:                UInt16;                                    {  <-  BCD }
  215.         csLevel:                UInt16;                                    {  <-  BCD }
  216.         reserved:                UInt16;                                    {   -> zero }
  217.         vStrLen:                UInt16;                                    {  <-> in: client's buffer size, out: vendor string length }
  218.         vendorString:            Ptr;                                    {  <-> in: pointer to buffer to hold CS vendor string (zero-terminated) }
  219.                                                                         {       out: CS vendor string copied to buffer }
  220.     END;
  221.  
  222. {
  223. ----------------        CSGetClientInfo                    ----------------
  224.  upper byte of attributes is kCSClientInfoSubfunction
  225. }
  226.     ClientInfoParamPtr = ^ClientInfoParam;
  227.     ClientInfoParam = RECORD
  228.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  229.         attributes:                UInt16;                                    {  <-> subfunction + bitmapped client attributes }
  230.         revision:                UInt16;                                    {  <-  BCD value of client's revision }
  231.         csLevel:                UInt16;                                    {  <-  BCD value of CS release }
  232.         revDate:                UInt16;                                    {  <-  revision date: y[15-9], m[8-5], d[4-0] }
  233.         nameLen:                SInt16;                                    {  <-> in: max length of client name string, out: actual length }
  234.         vStringLen:                SInt16;                                    {  <-> in: max length of vendor string, out: actual length }
  235.         nameString:                Ptr;                                    {  <-  pointer to client name string (zero-terminated) }
  236.         vendorString:            Ptr;                                    {  <-  pointer to vendor string (zero-terminated) }
  237.     END;
  238.  
  239. {
  240.  upper byte of attributes is kCSCardNameSubfunction,
  241.                                kCSCardTypeSubfunction,
  242.                                kCSHelpStringSubfunction
  243. }
  244.     AlternateTextStringParamPtr = ^AlternateTextStringParam;
  245.     AlternateTextStringParam = RECORD
  246.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  247.         attributes:                UInt16;                                    {  <-> subfunction + bitmapped client attributes }
  248.         socket:                    UInt16;                                    {   -> logical socket number }
  249.         reserved:                UInt16;                                    {   -> zero }
  250.         length:                    SInt16;                                    {  <-> in: max length of string, out: actual length }
  251.         text:                    Ptr;                                    {  <-  pointer to string (zero-terminated) }
  252.     END;
  253.  
  254. {  upper byte of attributes is kCSCardIconSubfunction }
  255.     AlternateCardIconParamPtr = ^AlternateCardIconParam;
  256.     AlternateCardIconParam = RECORD
  257.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  258.         attributes:                UInt16;                                    {  <-> subfunction + bitmapped client attributes }
  259.         socket:                    UInt16;                                    {   -> logical socket number }
  260.         iconSuite:                Handle;                                    {  <-  handle to icon suite containing all icons }
  261.     END;
  262.  
  263. {  upper byte of attributes is kCSActionProcSubfunction }
  264.     CustomActionProcParamPtr = ^CustomActionProcParam;
  265.     CustomActionProcParam = RECORD
  266.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  267.         attributes:                UInt16;                                    {  <-> subfunction + bitmapped client attributes }
  268.         socket:                    UInt16;                                    {   -> logical socket number }
  269.     END;
  270.  
  271.     GetClientInfoPBPtr = ^GetClientInfoPB;
  272.     GetClientInfoPB = RECORD
  273.         CASE INTEGER OF
  274.         0: (
  275.             clientInfo:            ClientInfoParam;
  276.             );
  277.         1: (
  278.             alternateTextString: AlternateTextStringParam;
  279.             );
  280.         2: (
  281.             alternateIcon:        AlternateCardIconParam;
  282.             );
  283.         3: (
  284.             customActionProc:    CustomActionProcParam;
  285.             );
  286.     END;
  287.  
  288. {     `attributes' field values }
  289.  
  290. CONST
  291.     kCSMemoryClient                = $0001;
  292.     kCSIOClient                    = $0004;
  293.     kCSClientTypeMask            = $0007;
  294.     kCSShareableCardInsertEvents = $0008;
  295.     kCSExclusiveCardInsertEvents = $0010;
  296.     kCSInfoSubfunctionMask        = $FF00;
  297.     kCSClientInfoSubfunction    = $0000;
  298.     kCSCardNameSubfunction        = $8000;
  299.     kCSCardTypeSubfunction        = $8100;
  300.     kCSHelpStringSubfunction    = $8200;
  301.     kCSCardIconSubfunction        = $8300;
  302.     kCSActionProcSubfunction    = $8400;
  303.  
  304. {
  305. ----------------        CSGetConfigurationInfo            ----------------
  306. ----------------        CSModifyConfiguration            ----------------
  307. ----------------        CSRequestConfiguration            ----------------
  308. }
  309.  
  310. TYPE
  311.     GetModRequestConfigInfoPBPtr = ^GetModRequestConfigInfoPB;
  312.     GetModRequestConfigInfoPB = RECORD
  313.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  314.         socket:                    UInt16;                                    {   -> logical socket number }
  315.         attributes:                UInt16;                                    {  <-> bitmap of configuration attributes }
  316.         vcc:                    SInt8;                                    {  <-> Vcc setting }
  317.         vpp1:                    SInt8;                                    {  <-> Vpp1 setting }
  318.         vpp2:                    SInt8;                                    {  <-> Vpp2 setting }
  319.         intType:                SInt8;                                    {  <-> interface type (memory or memory+I/O) }
  320.         configBase:                UInt32;                                    {  <-> card base address of configuration registers }
  321.         status:                    SInt8;                                    {  <-> card status register setting, if present }
  322.         pin:                    SInt8;                                    {  <-> card pin register setting, if present }
  323.         copy:                    SInt8;                                    {  <-> card socket/copy register setting, if present }
  324.         configIndex:            SInt8;                                    {  <-> card option register setting, if present }
  325.         present:                SInt8;                                    {  <-> bitmap of which configuration registers are present }
  326.         firstDevType:            SInt8;                                    {  <-  from DeviceID tuple }
  327.         funcCode:                SInt8;                                    {  <-  from FuncID tuple }
  328.         sysInitMask:            SInt8;                                    {  <-  from FuncID tuple }
  329.         manufCode:                UInt16;                                    {  <-  from ManufacturerID tuple }
  330.         manufInfo:                UInt16;                                    {  <-  from ManufacturerID tuple }
  331.         cardValues:                SInt8;                                    {  <-  valid card register values }
  332.         padding:                SInt8;                                    {   }
  333.     END;
  334.  
  335. {     `attributes' field values }
  336.  
  337. CONST
  338.     kCSExclusivelyUsed            = $0001;
  339.     kCSEnableIREQs                = $0002;
  340.     kCSVccChangeValid            = $0004;
  341.     kCSVpp1ChangeValid            = $0008;
  342.     kCSVpp2ChangeValid            = $0010;
  343.     kCSValidClient                = $0020;
  344.     kCSSleepPower                = $0040;                        {  request that power be applied to socket during Sleep }
  345.     kCSLockSocket                = $0080;
  346.     kCSTurnOnInUse                = $0100;
  347.  
  348. {     `intType' field values }
  349.     kCSMemoryInterface            = $01;
  350.     kCSMemory_And_IO_Interface    = $02;
  351.  
  352. {     `present' field values }
  353.     kCSOptionRegisterPresent    = $01;
  354.     kCSStatusRegisterPresent    = $02;
  355.     kCSPinReplacementRegisterPresent = $04;
  356.     kCSCopyRegisterPresent        = $08;
  357.  
  358. {     `cardValues' field values }
  359.     kCSOptionValueValid            = $01;
  360.     kCSStatusValueValid            = $02;
  361.     kCSPinReplacementValueValid    = $04;
  362.     kCSCopyValueValid            = $08;
  363.  
  364. {
  365. ----------------        CSGetClientEventMask            ----------------
  366. ----------------        CSSetClientEventMask            ----------------
  367. }
  368.  
  369. TYPE
  370.     GetSetClientEventMaskPBPtr = ^GetSetClientEventMaskPB;
  371.     GetSetClientEventMaskPB = RECORD
  372.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  373.         attributes:                UInt16;                                    {  <-> bitmap of attributes }
  374.         eventMask:                UInt16;                                    {  <-> bitmap of events to be passed to client for this socket }
  375.         socket:                    UInt16;                                    {   -> logical socket number }
  376.     END;
  377.  
  378. {     `attributes' field values }
  379.  
  380. CONST
  381.     kCSEventMaskThisSocketOnly    = $0001;
  382.  
  383. {     `eventMask' field values }
  384.     kCSWriteProtectEvent        = $0001;
  385.     kCSCardLockChangeEvent        = $0002;
  386.     kCSEjectRequestEvent        = $0004;
  387.     kCSInsertRequestEvent        = $0008;
  388.     kCSBatteryDeadEvent            = $0010;
  389.     kCSBatteryLowEvent            = $0020;
  390.     kCSReadyChangeEvent            = $0040;
  391.     kCSCardDetectChangeEvent    = $0080;
  392.     kCSPMChangeEvent            = $0100;
  393.     kCSResetEvent                = $0200;
  394.     kCSSSUpdateEvent            = $0400;
  395.     kCSFunctionInterrupt        = $0800;
  396.     kCSAllEvents                = $FFFF;
  397.  
  398. {
  399. ----------------        CSGetFirstClient                ----------------
  400. ----------------        CSGetNextClient                    ----------------
  401. }
  402.  
  403. TYPE
  404.     GetClientPBPtr = ^GetClientPB;
  405.     GetClientPB = RECORD
  406.         clientHandle:            UInt32;                                    {  <-  clientHandle for this client }
  407.         socket:                    UInt16;                                    {   -> logical socket number }
  408.         attributes:                UInt16;                                    {   -> bitmap of attributes }
  409.     END;
  410.  
  411. {     `attributes' field values }
  412.  
  413. CONST
  414.     kCSClientsForAllSockets        = $0000;
  415.     kCSClientsThisSocketOnly    = $0001;
  416.  
  417. {
  418. ----------------        CSGetFirstTuple                    ----------------
  419. ----------------        CSGetNextTuple                    ----------------
  420. ----------------        CSGetTupleData                    ----------------
  421. }
  422.  
  423. TYPE
  424.     GetTuplePBPtr = ^GetTuplePB;
  425.     GetTuplePB = RECORD
  426.         socket:                    UInt16;                                    {   -> logical socket number }
  427.         attributes:                UInt16;                                    {   -> bitmap of attributes }
  428.         desiredTuple:            SInt8;                                    {   -> desired tuple code value, or $FF for all }
  429.         tupleOffset:            SInt8;                                    {   -> offset into tuple from link byte }
  430.         flags:                    UInt16;                                    {  <-> internal use }
  431.         linkOffset:                UInt32;                                    {  <-> internal use }
  432.         cisOffset:                UInt32;                                    {  <-> internal use }
  433.         CASE INTEGER OF
  434.         0: (
  435.             tupleCode:            SInt8;                                    {  <-  tuple code found }
  436.             tupleLink:            SInt8;                                    {  <-  link value for tuple found }
  437.            );
  438.         1: (
  439.             tupleDataMax:        UInt16;                                    {   -> maximum size of tuple data area }
  440.             tupleDataLen:        UInt16;                                    {  <-  number of bytes in tuple body }
  441.             tupleData:            TupleBody;                                {  <-  tuple data }
  442.            );
  443.     END;
  444.  
  445. {     `attributes' field values }
  446.  
  447. CONST
  448.     kCSReturnLinkTuples            = $0001;
  449.  
  450. {
  451. ----------------        CSRequestSocketMask                ----------------
  452. ----------------        CSReleaseSocketMask                ----------------
  453. }
  454.  
  455. TYPE
  456.     ReqRelSocketMaskPBPtr = ^ReqRelSocketMaskPB;
  457.     ReqRelSocketMaskPB = RECORD
  458.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  459.         socket:                    UInt16;                                    {   -> logical socket }
  460.         eventMask:                UInt16;                                    {   -> bitmap of events to be passed to client for this socket }
  461.     END;
  462.  
  463. {
  464.     `eventMask' field values (see above for Get/SetClientEventMask
  465. ----------------        CSGetStatus                        ----------------
  466. }
  467.     GetStatusPBPtr = ^GetStatusPB;
  468.     GetStatusPB = RECORD
  469.         socket:                    UInt16;                                    {   -> logical socket number }
  470.         cardState:                UInt16;                                    {  <-  current state of installed card }
  471.         socketState:            UInt16;                                    {  <-  current state of the socket }
  472.     END;
  473.  
  474. {     `cardState' field values }
  475.  
  476. CONST
  477.     kCSWriteProtected            = $0001;
  478.     kCSCardLocked                = $0002;
  479.     kCSEjectRequest                = $0004;
  480.     kCSInsertRequest            = $0008;
  481.     kCSBatteryDead                = $0010;
  482.     kCSBatteryLow                = $0020;
  483.     kCSReady                    = $0040;
  484.     kCSCardDetected                = $0080;
  485.  
  486. {     `socketState' field values }
  487.     kCSWriteProtectChanged        = $0001;
  488.     kCSCardLockChanged            = $0002;
  489.     kCSEjectRequestPending        = $0004;
  490.     kCSInsertRequestPending        = $0008;
  491.     kCSBatteryDeadChanged        = $0010;
  492.     kCSBatteryLowChanged        = $0020;
  493.     kCSReadyChanged                = $0040;
  494.     kCSCardDetectChanged        = $0080;
  495.  
  496. {
  497. ----------------        CSModifyWindow                    ----------------
  498. ----------------        CSReleaseWindow                    ----------------
  499. ----------------        CSRequestWindow                    ----------------
  500. }
  501.  
  502. TYPE
  503.     ReqModRelWindowPBPtr = ^ReqModRelWindowPB;
  504.     ReqModRelWindowPB = RECORD
  505.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  506.         windowHandle:            UInt32;                                    {  <-> window descriptor }
  507.         socket:                    UInt16;                                    {   -> logical socket number }
  508.         attributes:                UInt16;                                    {   -> window attributes (bitmap) }
  509.         base:                    UInt32;                                    {  <-> system base address }
  510.         size:                    UInt32;                                    {  <-> memory window size }
  511.         accessSpeed:            SInt8;                                    {   -> window access speed (bitmap) }
  512.                                                                         {         (not applicable for I/O mode) }
  513.         padding:                SInt8;                                    {   }
  514.     END;
  515.  
  516. {     `attributes' field values }
  517.  
  518. CONST
  519.     kCSMemoryWindow                = $0001;
  520.     kCSIOWindow                    = $0002;
  521.     kCSAttributeWindow            = $0004;                        {  not normally used by Card Services clients }
  522.     kCSWindowTypeMask            = $0007;
  523.     kCSEnableWindow                = $0008;
  524.     kCSAccessSpeedValid            = $0010;
  525.     kCSLittleEndian                = $0020;                        {  configure socket for little endianess }
  526.     kCS16BitDataPath            = $0040;
  527.     kCSWindowPaged                = $0080;                        {   }
  528.     kCSWindowShared                = $0100;
  529.     kCSWindowFirstShared        = $0200;                        {   }
  530.     kCSWindowProgrammable        = $0400;                        {   }
  531.  
  532. {     `accessSpeed' field values }
  533.     kCSDeviceSpeedCodeMask        = $07;
  534.     kCSSpeedExponentMask        = $07;
  535.     kCSSpeedMantissaMask        = $78;
  536.     kCSUseWait                    = $80;
  537.     kCSAccessSpeed250nsec        = $01;
  538.     kCSAccessSpeed200nsec        = $02;
  539.     kCSAccessSpeed150nsec        = $03;
  540.     kCSAccessSpeed100nsec        = $04;
  541.     kCSExtAccSpeedMant1pt0        = $01;
  542.     kCSExtAccSpeedMant1pt2        = $02;
  543.     kCSExtAccSpeedMant1pt3        = $03;
  544.     kCSExtAccSpeedMant1pt5        = $04;
  545.     kCSExtAccSpeedMant2pt0        = $05;
  546.     kCSExtAccSpeedMant2pt5        = $06;
  547.     kCSExtAccSpeedMant3pt0        = $07;
  548.     kCSExtAccSpeedMant3pt5        = $08;
  549.     kCSExtAccSpeedMant4pt0        = $09;
  550.     kCSExtAccSpeedMant4pt5        = $0A;
  551.     kCSExtAccSpeedMant5pt0        = $0B;
  552.     kCSExtAccSpeedMant5pt5        = $0C;
  553.     kCSExtAccSpeedMant6pt0        = $0D;
  554.     kCSExtAccSpeedMant7pt0        = $0E;
  555.     kCSExtAccSpeedMant8pt0        = $0F;
  556.     kCSExtAccSpeedExp1ns        = $00;
  557.     kCSExtAccSpeedExp10ns        = $01;
  558.     kCSExtAccSpeedExp100ns        = $02;
  559.     kCSExtAccSpeedExp1us        = $03;
  560.     kCSExtAccSpeedExp10us        = $04;
  561.     kCSExtAccSpeedExp100us        = $05;
  562.     kCSExtAccSpeedExp1ms        = $06;
  563.     kCSExtAccSpeedExp10ms        = $07;
  564.  
  565. {
  566. ----------------        CSRegisterClient                ----------------
  567. ----------------        CSDeregisterClient                ----------------
  568. }
  569. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  570.  
  571. TYPE
  572.     ClientCallbackPBPtr = ^ClientCallbackPB;
  573.     ClientCallbackPB = RECORD
  574.         message:                UInt16;                                    {   -> which event this is }
  575.         socket:                    UInt16;                                    {   -> logical socket number }
  576.         info:                    UInt16;                                    {   -> function-specific }
  577.         misc:                    UInt16;                                    {   -> function-specific }
  578.         reserved:                Ptr;                                    {   -> pointer to MTD request block }
  579.         buffer:                    Ptr;                                    {   -> function-specific }
  580.         clientData:                Ptr;                                    {   -> pointer to client's data (from RegisterClient) }
  581.     END;
  582.  
  583.     PCCardCSClientProcPtr = ProcPtr;  { FUNCTION PCCardCSClient(ccPBPtr: ClientCallbackPBPtr): UInt16; }
  584.  
  585.     PCCardCSClientUPP = UniversalProcPtr;
  586.  
  587. CONST
  588.     uppPCCardCSClientProcInfo = $000000E0;
  589.  
  590. FUNCTION NewPCCardCSClientProc(userRoutine: PCCardCSClientProcPtr): PCCardCSClientUPP;
  591.     {$IFC NOT GENERATINGCFM }
  592.     INLINE $2E9F;
  593.     {$ENDC}
  594.  
  595. FUNCTION CallPCCardCSClientProc(ccPBPtr: ClientCallbackPBPtr; userRoutine: PCCardCSClientUPP): UInt16;
  596.     {$IFC NOT GENERATINGCFM}
  597.     INLINE $205F, $4E90;
  598.     {$ENDC}
  599.  
  600. TYPE
  601.     RegisterClientPBPtr = ^RegisterClientPB;
  602.     RegisterClientPB = RECORD
  603.         clientHandle:            UInt32;                                    {  <-  client descriptor }
  604.         clientEntry:            PCCardCSClientUPP;                        {   -> universal procPtr to client's event handler }
  605.         attributes:                UInt16;                                    {   -> bitmap of client attributes }
  606.         eventMask:                UInt16;                                    {   -> bitmap of events to notify client }
  607.         clientData:                Ptr;                                    {   -> pointer to client's data }
  608.         version:                UInt16;                                    {   -> Card Services version this client expects }
  609.     END;
  610.  
  611. {
  612.     `attributes' field values (see GetClientInfo)
  613.     kCSMemoryClient                    = 0x0001,
  614.     kCSIOClient                        = 0x0004,
  615.     kCSShareableCardInsertEvents    = 0x0008,
  616.     kCSExclusiveCardInsertEvents    = 0x0010
  617. }
  618. {$ENDC}
  619. { ----------------        CSReleaseConfiguration            ---------------- }
  620.  
  621. TYPE
  622.     ReleaseConfigurationPBPtr = ^ReleaseConfigurationPB;
  623.     ReleaseConfigurationPB = RECORD
  624.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  625.         socket:                    UInt16;                                    {   ->  }
  626.     END;
  627.  
  628. { ----------------        CSResetCard                        ---------------- }
  629.     ResetCardPBPtr = ^ResetCardPB;
  630.     ResetCardPB = RECORD
  631.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  632.         socket:                    UInt16;                                    {   ->  }
  633.         attributes:                UInt16;                                    {   -> xxx }
  634.     END;
  635.  
  636. { ----------------        CSValidateCIS                    ---------------- }
  637.     ValidateCISPBPtr = ^ValidateCISPB;
  638.     ValidateCISPB = RECORD
  639.         socket:                    UInt16;                                    {   ->  }
  640.         chains:                    UInt16;                                    {   -> whether link/null tuples should be included }
  641.     END;
  642.  
  643. {
  644. ----------------        CSRequestIO                        ----------------
  645. ----------------        CSReleaseIO                        ----------------
  646. }
  647.     ReqRelIOPBPtr = ^ReqRelIOPB;
  648.     ReqRelIOPB = RECORD
  649.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  650.         socket:                    UInt16;                                    {   -> socket number }
  651.         reserved:                UInt16;
  652.         basePort1:                UInt16;                                    {     ->    base I/O port for range }
  653.         numPorts1:                SInt8;                                    {     ->    number of ports (e.g., bytes). }
  654.         attributes1:            SInt8;                                    {     ->    attributes }
  655.         basePort2:                UInt16;                                    {     ->    base I/O port for range }
  656.         numPorts2:                SInt8;                                    {     ->    number of ports }
  657.         attributes2:            SInt8;                                    {     ->    attributes }
  658.         ioAddrLines:            SInt8;                                    {     -> number of I/O lines decoded by card }
  659.         reserved1:                SInt8;
  660.     END;
  661.  
  662. { ----------------        CSVendorSpecific                ---------------- }
  663.     VendorSpecificPBPtr = ^VendorSpecificPB;
  664.     VendorSpecificPB = RECORD
  665.         clientHandle:            UInt32;                                    {   -> clientHandle returned by RegisterClient }
  666.         vsCode:                    UInt16;
  667.         socket:                    UInt16;
  668.         dataLen:                UInt32;                                    {   -> length of buffer pointed to by vsDataPtr }
  669.         vsDataPtr:                Ptr;                                    {   -> Card Services version this client expects }
  670.     END;
  671.  
  672. {     `vsCode' field values }
  673.  
  674. CONST
  675.     vsAppleReserved                = $0000;
  676.     vsEjectCard                    = $0001;
  677.     vsGetCardInfo                = $0002;
  678.     vsEnableSocketEvents        = $0003;
  679.     vsGetCardLocationIcon        = $0004;
  680.     vsGetCardLocationText        = $0005;
  681.     vsGetAdapterInfo            = $0006;
  682.  
  683. {
  684. ///////////////////////////////////////////////////////////////////////////////////////
  685.     GetAdapterInfo parameter block (vendor-specific call #6)
  686. }
  687.  
  688. TYPE
  689.     GetAdapterInfoPBPtr = ^GetAdapterInfoPB;
  690.     GetAdapterInfoPB = RECORD
  691.         attributes:                UInt32;                                    {  <-  capabilties of socket's adapter }
  692.         revision:                UInt16;                                    {  <-  id of adapter }
  693.         reserved:                UInt16;                                    {   }
  694.         numVoltEntries:            UInt16;                                    {  <-  number of valid voltage values }
  695.         voltages:                Ptr;                                    {  <-> array of BCD voltage values }
  696.     END;
  697.  
  698. {     `attributes' field values }
  699.  
  700. CONST
  701.     kCSLevelModeInterrupts        = $00000001;
  702.     kCSPulseModeInterrupts        = $00000002;
  703.     kCSProgrammableWindowAddr    = $00000004;
  704.     kCSProgrammableWindowSize    = $00000008;
  705.     kCSSocketSleepPower            = $00000010;
  706.     kCSSoftwareEject            = $00000020;
  707.     kCSLockableSocket            = $00000040;
  708.     kCSInUseIndicator            = $00000080;
  709.  
  710. {
  711. ///////////////////////////////////////////////////////////////////////////////////////
  712.     GetCardInfo parameter block (vendor-specific call #2)
  713. }
  714.  
  715. TYPE
  716.     GetCardInfoPBPtr = ^GetCardInfoPB;
  717.     GetCardInfoPB = RECORD
  718.         cardType:                SInt8;                                    {  <-  type of card in this socket (defined at top of file) }
  719.         subType:                SInt8;                                    {  <-  more detailed card type (defined at top of file) }
  720.         reserved:                UInt16;                                    {  <-> reserved (should be set to zero) }
  721.         cardNameLen:            UInt16;                                    {   -> maximum length of card name to be returned }
  722.         vendorNameLen:            UInt16;                                    {   -> maximum length of vendor name to be returned }
  723.         cardName:                Ptr;                                    {   -> pointer to card name string (read from CIS), or nil }
  724.         vendorName:                Ptr;                                    {   -> pointer to vendor name string (read from CIS), or nil }
  725.     END;
  726.  
  727. {     GetCardInfo card types }
  728.  
  729. CONST
  730.     kCSUnknownCardType            = 0;
  731.     kCSMultiFunctionCardType    = 1;
  732.     kCSMemoryCardType            = 2;
  733.     kCSSerialPortCardType        = 3;
  734.     kCSSerialOnlyType            = 0;
  735.     kCSDataModemType            = 1;
  736.     kCSFaxModemType                = 2;
  737.     kCSFaxAndDataModemMask        = 3;
  738.     kCSVoiceEncodingType        = 4;
  739.     kCSParallelPortCardType        = 4;
  740.     kCSFixedDiskCardType        = 5;
  741.     kCSUnknownFixedDiskType        = 0;
  742.     kCSATAInterface                = 1;
  743.     kCSRotatingDevice            = $00;
  744.     kCSSiliconDevice            = $80;
  745.     kCSVideoAdaptorCardType        = 6;
  746.     kCSNetworkAdaptorCardType    = 7;
  747.     kCSAIMSCardType                = 8;
  748.     kCSNumCardTypes                = 9;
  749.  
  750. FUNCTION CSVendorSpecific(VAR pb: VendorSpecificPB): OSErr;
  751.     {$IFC NOT GENERATINGCFM}
  752.     INLINE $7000, $AAF0;
  753.     {$ENDC}
  754. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  755. FUNCTION CSRegisterClient(VAR pb: RegisterClientPB): OSErr;
  756.     {$IFC NOT GENERATINGCFM}
  757.     INLINE $7001, $AAF0;
  758.     {$ENDC}
  759. FUNCTION CSDeregisterClient(VAR pb: RegisterClientPB): OSErr;
  760.     {$IFC NOT GENERATINGCFM}
  761.     INLINE $7002, $AAF0;
  762.     {$ENDC}
  763. {$ENDC}
  764. FUNCTION CSGetFirstTuple(VAR pb: GetTuplePB): OSErr;
  765.     {$IFC NOT GENERATINGCFM}
  766.     INLINE $7003, $AAF0;
  767.     {$ENDC}
  768. FUNCTION CSGetNextTuple(VAR pb: GetTuplePB): OSErr;
  769.     {$IFC NOT GENERATINGCFM}
  770.     INLINE $7004, $AAF0;
  771.     {$ENDC}
  772. FUNCTION CSGetTupleData(VAR pb: GetTuplePB): OSErr;
  773.     {$IFC NOT GENERATINGCFM}
  774.     INLINE $7005, $AAF0;
  775.     {$ENDC}
  776. FUNCTION CSGetConfigurationInfo(VAR pb: GetModRequestConfigInfoPB): OSErr;
  777.     {$IFC NOT GENERATINGCFM}
  778.     INLINE $7006, $AAF0;
  779.     {$ENDC}
  780. FUNCTION CSGetCardServicesInfo(VAR pb: GetCardServicesInfoPB): OSErr;
  781.     {$IFC NOT GENERATINGCFM}
  782.     INLINE $7007, $AAF0;
  783.     {$ENDC}
  784. FUNCTION CSGetStatus(VAR pb: GetStatusPB): OSErr;
  785.     {$IFC NOT GENERATINGCFM}
  786.     INLINE $7008, $AAF0;
  787.     {$ENDC}
  788. FUNCTION CSValidateCIS(VAR pb: ValidateCISPB): OSErr;
  789.     {$IFC NOT GENERATINGCFM}
  790.     INLINE $7009, $AAF0;
  791.     {$ENDC}
  792. FUNCTION CSGetFirstClient(VAR pb: GetClientPB): OSErr;
  793.     {$IFC NOT GENERATINGCFM}
  794.     INLINE $700F, $AAF0;
  795.     {$ENDC}
  796. FUNCTION CSGetNextClient(VAR pb: GetClientPB): OSErr;
  797.     {$IFC NOT GENERATINGCFM}
  798.     INLINE $7010, $AAF0;
  799.     {$ENDC}
  800. FUNCTION CSGetClientInfo(VAR pb: GetClientInfoPB): OSErr;
  801.     {$IFC NOT GENERATINGCFM}
  802.     INLINE $7011, $AAF0;
  803.     {$ENDC}
  804. FUNCTION CSResetCard(VAR pb: ResetCardPB): OSErr;
  805.     {$IFC NOT GENERATINGCFM}
  806.     INLINE $7012, $AAF0;
  807.     {$ENDC}
  808. FUNCTION CSRequestWindow(VAR pb: ReqModRelWindowPB): OSErr;
  809.     {$IFC NOT GENERATINGCFM}
  810.     INLINE $7013, $AAF0;
  811.     {$ENDC}
  812. FUNCTION CSModifyWindow(VAR pb: ReqModRelWindowPB): OSErr;
  813.     {$IFC NOT GENERATINGCFM}
  814.     INLINE $7014, $AAF0;
  815.     {$ENDC}
  816. FUNCTION CSReleaseWindow(VAR pb: ReqModRelWindowPB): OSErr;
  817.     {$IFC NOT GENERATINGCFM}
  818.     INLINE $7015, $AAF0;
  819.     {$ENDC}
  820. FUNCTION CSRequestConfiguration(VAR pb: GetModRequestConfigInfoPB): OSErr;
  821.     {$IFC NOT GENERATINGCFM}
  822.     INLINE $701B, $AAF0;
  823.     {$ENDC}
  824. FUNCTION CSModifyConfiguration(VAR pb: GetModRequestConfigInfoPB): OSErr;
  825.     {$IFC NOT GENERATINGCFM}
  826.     INLINE $701C, $AAF0;
  827.     {$ENDC}
  828. FUNCTION CSAccessConfigurationRegister(VAR pb: AccessConfigurationRegisterPB): OSErr;
  829.     {$IFC NOT GENERATINGCFM}
  830.     INLINE $701D, $AAF0;
  831.     {$ENDC}
  832. FUNCTION CSReleaseConfiguration(VAR pb: ReleaseConfigurationPB): OSErr;
  833.     {$IFC NOT GENERATINGCFM}
  834.     INLINE $701E, $AAF0;
  835.     {$ENDC}
  836. FUNCTION CSGetClientEventMask(VAR pb: GetSetClientEventMaskPB): OSErr;
  837.     {$IFC NOT GENERATINGCFM}
  838.     INLINE $701F, $AAF0;
  839.     {$ENDC}
  840. FUNCTION CSSetClientEventMask(VAR pb: GetSetClientEventMaskPB): OSErr;
  841.     {$IFC NOT GENERATINGCFM}
  842.     INLINE $7020, $AAF0;
  843.     {$ENDC}
  844. FUNCTION CSRequestSocketMask(VAR pb: ReqRelSocketMaskPB): OSErr;
  845.     {$IFC NOT GENERATINGCFM}
  846.     INLINE $7021, $AAF0;
  847.     {$ENDC}
  848. FUNCTION CSReleaseSocketMask(VAR pb: ReqRelSocketMaskPB): OSErr;
  849.     {$IFC NOT GENERATINGCFM}
  850.     INLINE $7022, $AAF0;
  851.     {$ENDC}
  852. {
  853.     Additional calls which are required for all I/O clients when running on
  854.     systems which do not reserve dedicated I/O-spaces for each PC Card.
  855. }
  856. FUNCTION CSRequestIO(VAR pb: ReqRelIOPB): OSErr;
  857.     {$IFC NOT GENERATINGCFM}
  858.     INLINE $7025, $AAF0;
  859.     {$ENDC}
  860. FUNCTION CSReleaseIO(VAR pb: ReqRelIOPB): OSErr;
  861.     {$IFC NOT GENERATINGCFM}
  862.     INLINE $7026, $AAF0;
  863.     {$ENDC}
  864. {$ALIGN RESET}
  865. {$POP}
  866.  
  867. {$SETC UsingIncludes := CardServicesIncludes}
  868.  
  869. {$ENDC} {__CARDSERVICES__}
  870.  
  871. {$IFC NOT UsingIncludes}
  872.  END.
  873. {$ENDC}
  874.